import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import * as echarts from 'echarts';
//导入ElementPlus组件
import ElementPlus from 'element-plus'
//导入ElementPluS的css
import 'element-plus/dist/index.css'
//引入图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

app.use(createPinia())
app.use(router)
//使用ElementPlus组件
app.use(ElementPlus)
app.mount('#app')
//全局注册图标库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    //图标注册成全局组件,组件名称是图标名称
    app.component(key, component)
  }